{% extends "layout.html" %}
{% block css %}
    <link href="static/buss/css/detail.css" rel="stylesheet" type="text/css"/>
{% endblock %}

{% block webinfo %}
    <div class="container">
        <div class="row">
            <div class="col-sm-12">
                <div class="btn-group pull-right m-t-15">
                    {% if not id and not taskdate %}
                        <a type="button" class="btn btn-tag dropdown-toggle waves-effect waves-light"
                           href="/downloadxls?pluginname={{ plugin_name }}"
                           id="download" style="color: white">下载
                        </a>
                    {% else %}
                        <a type="button" class="btn btn-tag dropdown-toggle waves-effect waves-light"
                           href="/downloadxls?taskid={{ id }}&taskdate={{ taskdate }}"
                           id="download" style="color: white">下载
                        </a>
                    {% endif %}

                </div>
                <div style="margin-top: 15px">
                    <span style="font-weight: bold;font-size: 20px;color:white">{{ plugin_name }} 数量:{{ count }}</span>
                </div>
            </div>
        </div>
        <div class="row" style="margin-bottom: 20px;margin-top: 20px">
            <div class="col-lg-12">
                {% for i in scanlist %}
                    <div class="tag">
                        <span class="label label-info"><a href="javascript:void(0)" class="taglink" target="_blank"
                                                          title="{{ i }}">{{ i.date() }}</a></span>
                    </div>
                {% endfor %}
            </div>
        </div>
        <div class="row">
            {% for i in item %}
                <div class="col-md-6 col-sm-6 col-lg-4">
                    <div class="portlet" style="min-height: 125px;">
                        <div class="portlet-heading portlet-default">
                            <a href="http://{{ i['ip'] }}:{{ i['port'] }}" target="_blank">
                                <h3 class="portlet-title" style="color:#358ace !important;">{{ i['ip'] }}:{{ i['port'] }}</h3>
                            </a>
                            {% if i['hostname'] %}
                                <p class="label label-server" style="line-height: 30px;">{{ i['hostname'] }}</p>
                            {% endif %}
                            <div class="portlet-widgets">
                                {% if i['vul_level'] == 0 %}
                                    <p class="label font-13 tag-danger">紧急</p>
                                {% elif i['vul_level'] == 1 %}
                                    <p class="label font-13 tag-high">高危</p>
                                {% elif i['vul_level'] == 2 %}
                                    <p class="label font-13 tag-middle">中危</p>
                                {% elif i['vul_level'] == 3 %}
                                    <p class="label font-13 tag-low">低危</p>
                                {% elif i['vul_level'] == 4 %}
                                    <p class="label tag-tip font-13">风险</p>
                                {% endif %}
                            </div>
                            <div class="clearfix"></div>
                        </div>
                        <div class="portlet-body">
                            <p>{{ i['info'] }}</p>
                        </div>
                    </div>
                </div>
            {% endfor %}
        </div>
        {% if count>60 %}
            <div class="row" style="position: absolute;top: 100%;left: 50%;margin: -80px 0 0 -212px;">
                <ul class="pagination pagination-split">
                    <li>
                        <a href="javascript:prePage()"><i class="fa fa-angle-left"></i>前一页</a>
                    </li>
                    {% if count % 60 ==0 %}
                        {% for i in range(1,count//60 + 1) %}
                            <li>
                                <a href="javascript:turnTo({{ i }})">{{ i }}</a>
                            </li>
                        {% endfor %}
                    {% else %}
                        {% for i in range(1,(count//60) + 2) %}
                            <li>
                                <a href="javascript:turnTo({{ i }})">{{ i }}</a>
                            </li>
                        {% endfor %}
                    {% endif %}
                    <li>
                        <a href="javascript:nextPage()">后一页<i class="fa fa-angle-right"></i></a>
                    </li>
                </ul>
            </div>
        {% endif %}
    </div>
{% endblock %}

{% block js %}
    <script src="static/plugin/bootstrap-datepicker/dist/js/bootstrap-datepicker.min.js"></script>
    <script src="static/buss/js/plugindetail.js"></script>
{% endblock %}
